﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using VK.Casemeet.Employees;

namespace VK.Casemeet.Web.Admin
{
    public partial class Site : System.Web.UI.MasterPage
    {
        public string AccountName;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EmployeeService.IsEmployee())
            {
                Response.Redirect("/Admin/Default.aspx");
            }
            else
            {
                AccountName = EmployeeService.GetSessionEmployee().Account;
            }
        }

        protected void butLeave_Click(object sender, EventArgs e)
        {
            EmployeeService.Leave();
            Response.Redirect("/Admin/Default.aspx");
        }

        public string GetSiteUrl()
        {
            if (EmployeeService.GetSessionEmployee().ProvinceID == 0)
            {
                return "/";
            }
            else
            {
                return "/Default_" + EmployeeService.GetSessionEmployee().ProvinceID + ".html";
            }
        }
    }
}